#!/bin/bash

REPORT_CHANGED=0
if [ $# -gt 0 ]; then
    REPORT_CHANGED=1
fi
CHANGED='false'

FOUND=$(brctl show | grep "^{{ bridge.phy_interface }}" | wc -l)
if [ $FOUND -eq 0 ]; then
    CHANGED='true'
    brctl addif {{ bridge.name }} {{ bridge.phy_interface }}
fi

if [ $REPORT_CHANGED -ne 0 ]; then
    echo -n $CHANGED
fi